<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改农资信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
<link href="${path}/res/js/webuploader/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form" action="${path}/repertory/update.json" method="post">
<div class="form">
	<div class="group">
		<div class="label">*农资名称:</div>
		<div class="item"><input type="text" name="materialName" id="materialName" value="${repertory.materialName }" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">*农资成分:</div>
		<div class="item"><input type="text" name="ingredient" id="ingredient" value="${repertory.ingredient }"  maxlength="100" /></div>
	</div>
	<div class="group">
		<div class="label">*农资批号:</div>
		<div class="item"><input type="text" name="batchNum" id="batchNum" value="${repertory.batchNum }"  maxlength="100" /></div>
	</div>
	<div class="group">
		<div class="label">*生产商:</div>
		<div class="item"><input type="text" name="producer" id="producer" value="${repertory.producer }"  maxlength="100" /></div>
	</div>
	<div class="group">
		<div class="label">*安全间隔期:</div>
		<div class="item"><input type="text" name="phi" id="phi" maxlength="100"  value="${repertory.phi }" /></div>
	</div>
	
	<div class="group">
		<div class="label">*规格:</div>
		<div class="item"><input type="text" name="specification" id="specification" maxlength="50" value="${repertory.specification }" /></div>
	</div>
	<div class="group">
		<div class="label">*型号:</div>
		<div class="item"><input type="text" name="model" id="model" maxlength="50" value="${repertory.model }" /></div>
	</div>
	
	<div class="group">
		<div class="label">农资图片:</div>
		<div class="item"><div id="repImg" class="myuploader myuploader-single">${repertory.repImg }</div></div>
	</div>
	<div class="group">
		<div class="label">*单位:</div>
		<div class="item"><input type="text" name="unit" id="unit" value="${repertory.unit }" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">备注:</div>
		<div class="item"><textarea id="remark" name="remark">${repertory.remark }</textarea></div>
	</div>
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" name="parkid" id="" value="${repertory.parkid }"/>
		<input type="hidden" name="repertoryid" id="" value="${repertory.repertoryid }"/>
		<input type="hidden" name="materialType" id="" value="${repertory.materialType }"/>
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp"%>
<script src="${path}/res/js/webuploader/webuploader.min.js" type="text/javascript"></script>
<script src="${path}/res/js/webuploader/myUploader.js" type="text/javascript"></script>
<script type="text/javascript">
var myuploader;
$(function() {
	myuploader = $("#repImg").myImgUploader({
		uploadDir: "rep_img"
	});
	
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "修改农资信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		if(!myuploader.isDone()){
			UiUtil.unlockButton('submit1');
			return
		}
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>